/****************************************************
          File Name:13-1_imply.cpp
          Author: Abby Cin
          Mail: abbytsing@gmail.com
          Created Time: Sat 03 Jan 2015 04:29:55 PM CST
*****************************************************/

#include "13-1.h"
#include <cstring>
#include <iostream>

Cd::Cd(const char *s1, const char *s2, int n, double x)
{
    strcpy(performers, s1);
    strcpy(label, s2);
    selections = n;
    playtime = x;
}

Cd::~Cd() {}

Cd & Cd::operator=(const Cd & d)
{
    if(this == &d)
        return *this;
    strcpy(performers, d.performers);
    strcpy(label, d.label);
    selections = d.selections;
    playtime = d.playtime;

    return *this;
}

void Cd::Report() const
{
    std::cout << performers << "\n"
        << label << "\n"
        << selections << "\n"
        << playtime << std::endl;
}

Classic::Classic(const char *s1, const char *s2, const char *s3, int n, double x)
    : Cd(s1, s2, n, x)
{
    strcpy(maintype, s3);
}

Classic::Classic()
    : Cd("none", "none", 0, 0.0)
{
    strcpy(maintype, "none");
}

void Classic::Report() const
{
    Cd::Report();
    std::cout << maintype << std::endl;
}
